﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace CommandMgr.Entities
{
    public class Command
    {
        [Flags]
        public enum CommandStatus : byte
        { 
            notavailable = 0, 
            idle = 1, 
            queued = 2, 
            dequeued = 3, 
            completed = 4, 
            failed = 5 
        };

        [Key]
        [StringLength(150)]
        public string Name { get; set; }
        public string Descr { get; set; }
        public DateTime LastUpdated { get; set; }
        public byte StatusCode { get; set; }
        public CommandStatus Status { get { return (CommandStatus)StatusCode; } set { StatusCode = (byte)value; } }
        public string Response { get; set; }

    }
}
